package com.wmm.fast.main.shop2simplefactory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 写写画画 收银业务
 * @Auther: Token360
 * @Date: 2018/9/5 14:41
 * @Description:
 */
public class ShopCashiersFactory {

    private static Logger log = LoggerFactory.getLogger(ShopCashiersFactory.class);

    /**
     * 工厂职责应该单一, 只负责构造Object ,应该与调用解耦
     * */
    public static ShopCashiersInterface executeAcceptCashers(int type,double payMoney) {
        ShopCashiersInterface shopCashiersInterface = null;
        double result = 0d;
        switch (type) {
            case 1:
               shopCashiersInterface = new ShopCashiersNormal();
               break;
            case 2:
                shopCashiersInterface = new ShopCashiersRebate(8);
                break;
            case 3:
                shopCashiersInterface = new ShopCashiersReturn(100, 30);
                break;
        }
        return shopCashiersInterface;
    }
}
